import { useAxios } from '@/hooks/web/useAxios'

const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 角色列表
export const ucSysRoleListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucSysRoleList',
      data: data
    }
  })
}

// 角色修改
export const ucSysRoleEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucSysRoleEdit',
      data: data
    }
  })
}

// 角色新增
export const ucSysRoleAddApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucSysRoleAddAdmin',
      data: data
    }
  })
}

// 角色删除
export const ucSysRoleDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucSysRoleDel',
      data: data
    }
  })
}

// 角色批量删除
export const ucSysRoleBatchDelApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucSysRoleBatchDel',
      data: data
    }
  })
}

// 角色功能权限编辑
export const ucSysRoleFaEditApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucSysRoleFaEdit',
      data: data
    }
  })
}

// 角色功能权限查看
export const ucSysRoleFaSeeApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'ucSysRoleFaSee',
      data: data
    }
  })
}
